package cn.tedu.ezhaung_project.controller;

import cn.tedu.ezhaung_project.mapper.ProductMapper;
import cn.tedu.ezhaung_project.pojo.vo.ProductDetailVO;
import cn.tedu.ezhaung_project.pojo.vo.ProductSelectVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/product/")
public class ProductController {
    @Autowired(required = false)
    ProductMapper mapper;
    @RequestMapping("select")
    public List<ProductSelectVO>select(){
        return mapper.select();
    }
    @RequestMapping("selectByCid")
    public List<ProductSelectVO> selectByCid(int id){
        return mapper.selectByCid(id);
    }
    @RequestMapping("selectByWd")
    public List<ProductSelectVO> selectByWd(String wd){
        return mapper.selectByWd(wd);
    }
    @RequestMapping("selectDetailById")
    public ProductDetailVO selectDetailById(int id){
        return mapper.selectDetailById(id);
    }

}
